package ua.kpi.apolonov.questions;

/**
 * Class for analysis structure of a question which is received from a file
 * @version 1.1
 * @author Yegor Apolonov
 */

public class FileQuestionStructure {
	
	/*Defaults for question types except type "multiple"*/
	private int trueAnswersNumber = 1;
	private int offsetToAnswers = 2;
	private int answersSize;
	private String[] detailsOfQuestion;
	private String questionType;
	
	public FileQuestionStructure(String[] detailsOfQuestion) {
		this.detailsOfQuestion = detailsOfQuestion; 
		recalculateAnswersSize();
		questionType = detailsOfQuestion[0];
	}
	
	public void recalculateAnswersSize() {
		answersSize = detailsOfQuestion.length - offsetToAnswers;
	}
	
	public void setOffsetToAnswers(int offsetToAnswers) {
		this.offsetToAnswers = offsetToAnswers;
	}
	
	public int getOffsetToAnswers() {
		return offsetToAnswers;
	}
	
	public void setAnswersSize(int answersSize) {
		this.answersSize = answersSize;
	}
	
	public int getAnswersSize() {
		return answersSize;
	}
	
	public void setTrueAnswersNumber(int trueAnswersNumber) {
		this.trueAnswersNumber = trueAnswersNumber;
	}
	
	public int getTrueAnswersNumber() {
		return trueAnswersNumber;
	}
	
	public String getQuestionType() {
		return questionType;
	}
}
